<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:p="http://primefaces.org/ui" 
	  xmlns:c="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:f="http://java.sun.com/jsf/core">
	  
	<h:head>
		<title></title>
	</h:head>
	
	<h:body style="font-size: 11px"> 
	
		<p:layout fullPage="true" >
			
			<p:layoutUnit position="north" size="100" >
				
			</p:layoutUnit>
			
			<p:layoutUnit position="west" size="35%" >	
				<h:form>
					<p:panelGrid columns="2">
						<h:outputLabel value="#{lang.getTrans('ui.mobile.sale.produto.code')}"/>
						<p:inputText value="#{saleBean.product.cdCode}" />
						<h:outputLabel value="#{lang.getTrans('ui.mobile.sale.produto.quantity')}"/>
						<p:inputText value="#{saleBean.product.nrQuantity}" />	
					
						<p:commandButton ajax="false" type="submit" action="#{saleBean.addProduct}"  value="#{lang.getTrans('ui.mobile.common.add')}" />
					</p:panelGrid>	
			 	</h:form>
				
						
			</p:layoutUnit>
			
			<p:layoutUnit position="center" size="65%">
				<p:dataTable id="gridProducts" var="product" value="#{saleBean.products}" >
					
					<p:column id="cdCode">
						<f:facet name="header">	#{lang.getTrans("ui.mobile.sale.code")} </f:facet>
						<h:outputText value="#{product.cdCode}"/>	
					</p:column>	

					<p:column id="nrQuantity">
						<f:facet name="header">	#{lang.getTrans("ui.mobile.sale.quantity")} </f:facet>
						<h:outputText value="#{product.nrQuantity}"/>	
					</p:column>	
										
					<p:column id="cdProduct">
						<f:facet name="header">	#{lang.getTrans("ui.mobile.sale.product")} </f:facet>
						<h:outputText value="#{product.cdProduct}"/>	
					</p:column>	

					
					<p:column id="nrPriceSale">
						<f:facet name="header">	#{lang.getTrans("ui.mobile.sale.price.sale")} </f:facet>
						<h:outputText value="#{product.nrPriceSale}"/>	
					</p:column>	
					
					<p:column id="nrPriceTotal">
						<f:facet name="header">	#{lang.getTrans("ui.mobile.sale.price.total")} </f:facet>
						<h:outputText value="#{product.nrPriceTotal}"/>	
					</p:column>	
						
				</p:dataTable>
				
				<h:form>
					<p:commandButton value="#{lang.getTrans('ui.mobile.sale.concluir')}" 
						action="#{saleBean.addSale}" ajax="false"/>
				</h:form>
				
				
			</p:layoutUnit>
			
		</p:layout>
	
		
	</h:body>
	
</html>